---
title: Uniscript
icon: Terminal
---

<MetaData
  lang="en-US"
  meta={{
    plugins: [{
      client: '@univerjs/uniscript',
      locale: '@univerjs/uniscript/locale/en-US',
      style: '@univerjs/uniscript/lib/index.css',
    }],
    server: 'No',
  }}
/>

Uniscript provides the ability to quickly add or edit Facade APIs online. After installation, a new button will appear in the toolbar. Clicking it will open a sidebar where you can enter and execute code. Any code starting with `univerAPI` in our documentation can be executed here.

<Callout title="Good to Know">
  The panel of Uniscript injects an instance object of the Facade API called `univerAPI`, which can be used directly to call the Facade APIs mentioned in the documentation.
</Callout>

## Preset Mode

Uniscript does not provide a preset, but it supports mixing with its plugins.

### Installation

```package-install
npm install @univerjs/uniscript
```

### Usage

```typescript
import { UniverUniscriptPlugin } from '@univerjs/uniscript' // [!code ++]

import '@univerjs/uniscript/lib/index.css' // [!code ++]

const { univerAPI } = createUniver({
  locale: LocaleType.EN_US,
  locales: {
    [LocaleType.EN_US]: mergeLocales(
      UniverPresetSheetsCoreEnUS,
      UniscriptEnUS, // [!code ++]
    ),
  },
  presets: [
    UniverSheetsCorePreset(),
  ],
  plugins: [
    UniverUniscriptPlugin, // [!code ++]
  ],
})
```

## Plugin Mode

### Installation

```package-install
npm install @univerjs/uniscript
```

### Usage

```typescript
import { LocaleType, mergeLocales, Univer } from '@univerjs/core'
import { UniverUniscriptPlugin } from '@univerjs/uniscript' // [!code ++]

import '@univerjs/uniscript/lib/index.css' // [!code ++]

const univer = new Univer({
  locale: LocaleType.EN_US,
  locales: {
    [LocaleType.EN_US]: mergeLocales(
      UniscriptEnUS, // [!code ++]
    ),
  },
})

univer.registerPlugin(UniverUniscriptPlugin) // [!code ++]
```
